<?php
  header('Content-Type:application/json; charset=UTF-8');
  session_start();
  if(isset($_SESSION['userflag'])){

    if (is_array($_POST)&&isset($_POST["type"])){
        $filename = $_POST["type"].'.json';

        $idx = $_POST['idx'];
        $strArr = file($filename);


      array_splice($strArr,$idx+1,1);

      file_put_contents($filename, $strArr);
      echo '{"status" :1 , "msg" :"删除成功！"}';
    }
  }else{
      echo '{"status" :0 , "msg" :"未登陆"}';
  }
 
